<!DOCTYPE html>
<html xmlns="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<title>公告广场</title>
		<link data-th-include="commons/frame :: resource" />
	</head>
	<body class="backgroud-body">
		<div class="layui-row" id="test">
			<div class="layui-col-md2 sidebar">
			</div>
			<div class="layui-col-md8 middle">
				<!-- 发布表单 !-->
				<div class="choose-button">
					<form class="layui-form" action="/addAnn" method="post">

						<div style="margin-right: 10%;">
							<div class="layui-form-item">
								<label class="layui-form-label">请输入公告的标题</label>
								<div class="layui-input-block">
									<input type="text" name="announcementTitle" required lay-verify="required" placeholder="请输入公告的标题" autocomplete="off" class="layui-input">
								</div>
							</div>

							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label">请输入公告的内容</label>
								<div class="layui-input-block">
									<textarea name="announcementContent" placeholder="请输入公告的内容" class="layui-textarea"></textarea>
								</div>
							</div>
						</div>

						<div class="layui-form-item" id="input-top">
							<div class="layui-input-block" id="layui-input-block-right">
								<button class="layui-btn" lay-submit lay-filter="formDemo">发布公告</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
							</div>
						</div>
					</form>
				</div>


				<!-- 公告区域 !-->
				<div class="layui-tab layui-tab-brief choose-button" lay-filter="docDemoTabBrief">
					<ul class="layui-tab-title">
						<li class="layui-this">公司公告</li>
						<li>部门公告</li>
					</ul>
					<div class="layui-tab-content" id="t-content">
						<div class="layui-tab-item layui-show">
							<div data-th-each="result : ${result}" data-th-object="${result}">
								<div class="layui-row" data-th-each="userList : ${result.userList}">
									<div class="layui-col-md3">
										<img data-th-src="@{__${userList.img}__}" class="photo">
									</div>
									<div class="layui-col-md9">
										<div class="layui-col-md12">
											<h1 class="title-style" data-th-text="*{announcementTitle}">关于虹猫禁止996的公司规定</h1>
										</div>
										<div class="layui-col-md12">
											<h3 class="author-style" data-th-text="${userList.nickname}">作者</h3>
										</div>
										<div class="layui-col-md12">
											<h3 class="author-style" data-th-text="*{#dates.format(createTime,'yyyy-MM-dd HH:mm:ss')}">时间</h3>
										</div>
									</div>
									<div class="layui-col-md12">
										<p class="context-style" data-th-text="*{announcementContent}">内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</p>
									</div>
								</div>
							</div>
						</div>
						<div class="layui-tab-item">
							<div data-th-each="result : ${DepartmentMsg}" data-th-object="${result}">

								<div class="layui-row" data-th-each="userList : ${result.userList}">
									<div class="layui-col-md3">
										<img data-th-src="@{__${userList.img}__}" class="photo">
									</div>
									<div class="layui-col-md9">
										<div class="layui-col-md12">
											<h1 class="title-style" data-th-text="*{announcementTitle}"></h1>
										</div>
										<div class="layui-col-md12">
											<h3 class="author-style" data-th-text="${userList.nickname}"></h3>
										</div>
										<div class="layui-col-md12">
											<h3 class="author-style" data-th-text="*{#dates.format(createTime,'yyyy-MM-dd HH:mm:ss')}"></h3>
										</div>
									</div>
									<div class="layui-col-md12">
										<p class="context-style" data-th-text="*{announcementContent}"></p>
									</div>
								</div>

							</div>
						</div>
					</div>
				</div>



				<div class="layui-col-md2 sidebar">

				</div>
			</div>
	</body>
</html>

<script type="text/javascript">
	autodivheight();

	function autodivheight() { //函数：获取尺寸
		//获取浏览器窗口高度
		var winHeight = 0;
		if (window.innerHeight) {
			winHeight = window.innerHeight;
		} else if ((document.body) && (document.body.clientHeight)) {
			winHeight = document.body.clientHeight;
		}
		//通过深入Document内部对body进行检测，获取浏览器窗口高度
		if (document.documentElement && document.documentElement.clientHeight) {
			winHeight = document.documentElement.clientHeight;
		}
		//DIV高度为浏览器窗口的高度
		document.getElementById("test").style.height = winHeight + "px";
	}
	window.onresize = autodivheight; //浏览器窗口发生变化时同时变化DIV高度
</script>

<script>
	//注意：选项卡 依赖 element 模块，否则无法进行功能性操作
	layui.use('element', function() {
		var element = layui.element;

	});
</script>

<script type="text/javascript" data-th-if="${errorMessage!=null}">
	$(function() {
		layui.use('form', function() {
			layer.msg('[[${errorMessage}]]')
		})
	})
</script>